package com.chinapost.po;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Tuser entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "TUSER", schema = "YXJF", uniqueConstraints = @UniqueConstraint(columnNames = "CBH"))
public class Tuser implements java.io.Serializable {

	// Fields

	private String cid;
	private Tyglb tyglb;
	private Tdept tdept;
	private String cname;
	private String cpwd;
	private Timestamp ccreatedate;
	private Timestamp cmodifydate;
	private Integer clogin;
	private Integer cstate;
	private Timestamp clastlogin;
	private String cbh;
	private Integer ckind;
	private Set<Tyxsj> tyxsjsForCmodifyuserid = new HashSet<Tyxsj>(0);
	private Set<Tjhrw> tjhrwsForCcreateuserid = new HashSet<Tjhrw>(0);
	private Set<Tyxjl> tyxjlsForCcreateuserid = new HashSet<Tyxjl>(0);
	private Set<Tyxsj> tyxsjsForCcreateuserid = new HashSet<Tyxsj>(0);
	private Set<Tjfsz> tjfszsForCcreateuserid = new HashSet<Tjfsz>(0);
	private Set<Tjfsz> tjfszsForCmodifyuserid = new HashSet<Tjfsz>(0);
	private Set<Tyxsj> tyxsjsForCuserid = new HashSet<Tyxsj>(0);
	private Set<Trole> troles = new HashSet<Trole>(0);
	private Set<Tjhrw> tjhrwsForCmodifyuserid = new HashSet<Tjhrw>(0);
	private Set<Ttqsj> ttqsjsForCuserid = new HashSet<Ttqsj>(0);
	private Set<Ttqsj> ttqsjsForCcreateuserid = new HashSet<Ttqsj>(0);
	private Set<Tycsj> tycsjsForCcreateuserid = new HashSet<Tycsj>(0);
	private Set<Tycsj> tycsjsForCmodifyuserid = new HashSet<Tycsj>(0);
	private Set<Tycsj> tycsjsForCuserid = new HashSet<Tycsj>(0);
	private Set<Tyxjl> tyxjlsForCmodifyuserid = new HashSet<Tyxjl>(0);
	private Set<Ttqsj> ttqsjsForCmodifyuserid = new HashSet<Ttqsj>(0);

	// Constructors

	/** default constructor */
	public Tuser() {
	}

	/** minimal constructor */
	public Tuser(String cid, Tdept tdept, String cname, String cpwd, String cbh) {
		this.cid = cid;
		this.tdept = tdept;
		this.cname = cname;
		this.cpwd = cpwd;
		this.cbh = cbh;
	}

	/** full constructor */
	public Tuser(String cid, Tyglb tyglb, Tdept tdept, String cname, String cpwd, Timestamp ccreatedate, Timestamp cmodifydate, Integer clogin, Integer cstate, Timestamp clastlogin, String cbh, Integer ckind, Set<Tyxsj> tyxsjsForCmodifyuserid, Set<Tjhrw> tjhrwsForCcreateuserid, Set<Tyxjl> tyxjlsForCcreateuserid, Set<Tyxsj> tyxsjsForCcreateuserid, Set<Tjfsz> tjfszsForCcreateuserid, Set<Tjfsz> tjfszsForCmodifyuserid, Set<Tyxsj> tyxsjsForCuserid, Set<Trole> troles, Set<Tjhrw> tjhrwsForCmodifyuserid, Set<Ttqsj> ttqsjsForCuserid, Set<Ttqsj> ttqsjsForCcreateuserid, Set<Tycsj> tycsjsForCcreateuserid, Set<Tycsj> tycsjsForCmodifyuserid, Set<Tycsj> tycsjsForCuserid, Set<Tyxjl> tyxjlsForCmodifyuserid, Set<Ttqsj> ttqsjsForCmodifyuserid) {
		this.cid = cid;
		this.tyglb = tyglb;
		this.tdept = tdept;
		this.cname = cname;
		this.cpwd = cpwd;
		this.ccreatedate = ccreatedate;
		this.cmodifydate = cmodifydate;
		this.clogin = clogin;
		this.cstate = cstate;
		this.clastlogin = clastlogin;
		this.cbh = cbh;
		this.ckind = ckind;
		this.tyxsjsForCmodifyuserid = tyxsjsForCmodifyuserid;
		this.tjhrwsForCcreateuserid = tjhrwsForCcreateuserid;
		this.tyxjlsForCcreateuserid = tyxjlsForCcreateuserid;
		this.tyxsjsForCcreateuserid = tyxsjsForCcreateuserid;
		this.tjfszsForCcreateuserid = tjfszsForCcreateuserid;
		this.tjfszsForCmodifyuserid = tjfszsForCmodifyuserid;
		this.tyxsjsForCuserid = tyxsjsForCuserid;
		this.troles = troles;
		this.tjhrwsForCmodifyuserid = tjhrwsForCmodifyuserid;
		this.ttqsjsForCuserid = ttqsjsForCuserid;
		this.ttqsjsForCcreateuserid = ttqsjsForCcreateuserid;
		this.tycsjsForCcreateuserid = tycsjsForCcreateuserid;
		this.tycsjsForCmodifyuserid = tycsjsForCmodifyuserid;
		this.tycsjsForCuserid = tycsjsForCuserid;
		this.tyxjlsForCmodifyuserid = tyxjlsForCmodifyuserid;
		this.ttqsjsForCmodifyuserid = ttqsjsForCmodifyuserid;
	}

	// Property accessors
	@Id
	@Column(name = "CID", unique = true, nullable = false, length = 36)
	public String getCid() {
		return this.cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CYGLB")
	public Tyglb getTyglb() {
		return this.tyglb;
	}

	public void setTyglb(Tyglb tyglb) {
		this.tyglb = tyglb;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CDEPTID", nullable = false)
	public Tdept getTdept() {
		return this.tdept;
	}

	public void setTdept(Tdept tdept) {
		this.tdept = tdept;
	}

	@Column(name = "CNAME", nullable = false, length = 20)
	public String getCname() {
		return this.cname;
	}

	public void setCname(String cname) {
		this.cname = cname;
	}

	@Column(name = "CPWD", nullable = false, length = 32)
	public String getCpwd() {
		return this.cpwd;
	}

	public void setCpwd(String cpwd) {
		this.cpwd = cpwd;
	}

	@Column(name = "CCREATEDATE", length = 11)
	public Timestamp getCcreatedate() {
		return this.ccreatedate;
	}

	public void setCcreatedate(Timestamp ccreatedate) {
		this.ccreatedate = ccreatedate;
	}

	@Column(name = "CMODIFYDATE", length = 11)
	public Timestamp getCmodifydate() {
		return this.cmodifydate;
	}

	public void setCmodifydate(Timestamp cmodifydate) {
		this.cmodifydate = cmodifydate;
	}

	@Column(name = "CLOGIN", precision = 8, scale = 0)
	public Integer getClogin() {
		return this.clogin;
	}

	public void setClogin(Integer clogin) {
		this.clogin = clogin;
	}

	@Column(name = "CSTATE", precision = 5, scale = 0)
	public Integer getCstate() {
		return this.cstate;
	}

	public void setCstate(Integer cstate) {
		this.cstate = cstate;
	}

	@Column(name = "CLASTLOGIN", length = 11)
	public Timestamp getClastlogin() {
		return this.clastlogin;
	}

	public void setClastlogin(Timestamp clastlogin) {
		this.clastlogin = clastlogin;
	}

	@Column(name = "CBH", unique = true, nullable = false, length = 20)
	public String getCbh() {
		return this.cbh;
	}

	public void setCbh(String cbh) {
		this.cbh = cbh;
	}

	@Column(name = "CKIND", precision = 5, scale = 0)
	public Integer getCkind() {
		return this.ckind;
	}

	public void setCkind(Integer ckind) {
		this.ckind = ckind;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCmodifyuserid")
	public Set<Tyxsj> getTyxsjsForCmodifyuserid() {
		return this.tyxsjsForCmodifyuserid;
	}

	public void setTyxsjsForCmodifyuserid(Set<Tyxsj> tyxsjsForCmodifyuserid) {
		this.tyxsjsForCmodifyuserid = tyxsjsForCmodifyuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCcreateuserid")
	public Set<Tjhrw> getTjhrwsForCcreateuserid() {
		return this.tjhrwsForCcreateuserid;
	}

	public void setTjhrwsForCcreateuserid(Set<Tjhrw> tjhrwsForCcreateuserid) {
		this.tjhrwsForCcreateuserid = tjhrwsForCcreateuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCcreateuserid")
	public Set<Tyxjl> getTyxjlsForCcreateuserid() {
		return this.tyxjlsForCcreateuserid;
	}

	public void setTyxjlsForCcreateuserid(Set<Tyxjl> tyxjlsForCcreateuserid) {
		this.tyxjlsForCcreateuserid = tyxjlsForCcreateuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCcreateuserid")
	public Set<Tyxsj> getTyxsjsForCcreateuserid() {
		return this.tyxsjsForCcreateuserid;
	}

	public void setTyxsjsForCcreateuserid(Set<Tyxsj> tyxsjsForCcreateuserid) {
		this.tyxsjsForCcreateuserid = tyxsjsForCcreateuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCcreateuserid")
	public Set<Tjfsz> getTjfszsForCcreateuserid() {
		return this.tjfszsForCcreateuserid;
	}

	public void setTjfszsForCcreateuserid(Set<Tjfsz> tjfszsForCcreateuserid) {
		this.tjfszsForCcreateuserid = tjfszsForCcreateuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCmodifyuserid")
	public Set<Tjfsz> getTjfszsForCmodifyuserid() {
		return this.tjfszsForCmodifyuserid;
	}

	public void setTjfszsForCmodifyuserid(Set<Tjfsz> tjfszsForCmodifyuserid) {
		this.tjfszsForCmodifyuserid = tjfszsForCmodifyuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCuserid")
	public Set<Tyxsj> getTyxsjsForCuserid() {
		return this.tyxsjsForCuserid;
	}

	public void setTyxsjsForCuserid(Set<Tyxsj> tyxsjsForCuserid) {
		this.tyxsjsForCuserid = tyxsjsForCuserid;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinTable(name = "TUSER_TROLE", schema = "YXJF", joinColumns = { @JoinColumn(name = "CUSERID", nullable = false, updatable = false) }, inverseJoinColumns = { @JoinColumn(name = "CROLEID", nullable = false, updatable = false) })
	public Set<Trole> getTroles() {
		return this.troles;
	}

	public void setTroles(Set<Trole> troles) {
		this.troles = troles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCmodifyuserid")
	public Set<Tjhrw> getTjhrwsForCmodifyuserid() {
		return this.tjhrwsForCmodifyuserid;
	}

	public void setTjhrwsForCmodifyuserid(Set<Tjhrw> tjhrwsForCmodifyuserid) {
		this.tjhrwsForCmodifyuserid = tjhrwsForCmodifyuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCuserid")
	public Set<Ttqsj> getTtqsjsForCuserid() {
		return this.ttqsjsForCuserid;
	}

	public void setTtqsjsForCuserid(Set<Ttqsj> ttqsjsForCuserid) {
		this.ttqsjsForCuserid = ttqsjsForCuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCcreateuserid")
	public Set<Ttqsj> getTtqsjsForCcreateuserid() {
		return this.ttqsjsForCcreateuserid;
	}

	public void setTtqsjsForCcreateuserid(Set<Ttqsj> ttqsjsForCcreateuserid) {
		this.ttqsjsForCcreateuserid = ttqsjsForCcreateuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCcreateuserid")
	public Set<Tycsj> getTycsjsForCcreateuserid() {
		return this.tycsjsForCcreateuserid;
	}

	public void setTycsjsForCcreateuserid(Set<Tycsj> tycsjsForCcreateuserid) {
		this.tycsjsForCcreateuserid = tycsjsForCcreateuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCmodifyuserid")
	public Set<Tycsj> getTycsjsForCmodifyuserid() {
		return this.tycsjsForCmodifyuserid;
	}

	public void setTycsjsForCmodifyuserid(Set<Tycsj> tycsjsForCmodifyuserid) {
		this.tycsjsForCmodifyuserid = tycsjsForCmodifyuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCuserid")
	public Set<Tycsj> getTycsjsForCuserid() {
		return this.tycsjsForCuserid;
	}

	public void setTycsjsForCuserid(Set<Tycsj> tycsjsForCuserid) {
		this.tycsjsForCuserid = tycsjsForCuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCmodifyuserid")
	public Set<Tyxjl> getTyxjlsForCmodifyuserid() {
		return this.tyxjlsForCmodifyuserid;
	}

	public void setTyxjlsForCmodifyuserid(Set<Tyxjl> tyxjlsForCmodifyuserid) {
		this.tyxjlsForCmodifyuserid = tyxjlsForCmodifyuserid;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "tuserByCmodifyuserid")
	public Set<Ttqsj> getTtqsjsForCmodifyuserid() {
		return this.ttqsjsForCmodifyuserid;
	}

	public void setTtqsjsForCmodifyuserid(Set<Ttqsj> ttqsjsForCmodifyuserid) {
		this.ttqsjsForCmodifyuserid = ttqsjsForCmodifyuserid;
	}

}